#coding=utf-8
import json
def Readtxt(file):
    params=[]
    with open(file,'r',encoding='utf-8') as f:
        for i in f.readlines():
            params.append(i.strip('\n').split(',')) #strip 删除两边的某个字段  split通过指定分隔符对字符串进行切片
    return params
def readtxt(file):
    with open(file,'r',encoding='utf-8')as f:
        txt=f.read()
    return txt


def readjson(file):
    with open(file,'r',encoding='utf-8') as f :
        json_data=json.load(f)
        '''写入json文件的话用dump()方法'''
    return json_data

def writetxt(file,txt):
    with open(file,'w',encoding='utf-8') as f:
        f.write(txt)

if __name__ == '__main__':
    writetxt(r'E:\my_Framework\data\测试.txt','111')
    a=readtxt(r'E:\my_Framework\data\测试.txt')
    print(a)